//
//  AppNotificationHelpper.m
//  XiaoMiao
//
//  Created by 23 on 2017/11/22.
//  Copyright © 2017年 smallyou. All rights reserved.
//

#import "AppNotificationHelpper.h"

@implementation AppNotificationHelpper

+ (void)postNotificationName:(NSString *)aName object:(id)anObject {
    dispatch_async(dispatch_get_main_queue(), ^{
        [[NSNotificationCenter defaultCenter] postNotificationName:aName object:anObject];
    });
}

+ (void)postNotification:(NSString *)notification userInfo:(NSDictionary *)userInfo object:(id)object {
    dispatch_async(dispatch_get_main_queue(), ^{
        [[NSNotificationCenter defaultCenter] postNotificationName:notification object:object userInfo:userInfo];
    });
}

+ (void)addObserver:(id)observer selector:(SEL)aSelector name:(NSString *)aName object:(id)anObject {
    dispatch_async(dispatch_get_main_queue(), ^{
        [[NSNotificationCenter defaultCenter] addObserver:observer selector:aSelector name:aName object:anObject];
    });
}

+ (void)removeObserver:(id)observer{
    [[NSNotificationCenter defaultCenter] removeObserver:observer];
}

+(void)removeObserver:(id)observer name:(NSString *)aName object:(id)anObject {
    [[NSNotificationCenter defaultCenter] removeObserver:observer name:aName object:anObject];
}

@end
